/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package structures.grammar;

import static common.Constants.EMPTY;
import structures.ExtendedList;
import structures.table.symboltable.ItemInfo;

/**
 *
 * @author Slayer
 */
public class ItemList extends ExtendedList<ItemInfo> implements Cloneable {

    /**
     * Checks if expansion contains only empty terminal
     *
     * @return True - if empty, false - otherwise
     */
    public boolean isEmptyExpansion() {
        return size() == 1 && get(0).equals(EMPTY);
    }

    public ItemList(ItemInfo... items) {
        super(items);
    }

    public ItemList() {
    }

    @Override
    public Object clone() {
        ItemList list = new ItemList();

        for (ItemInfo item : this) {
            list.add((ItemInfo) item.clone());
        }

        return list;
    }
}
